package com.yunji.base.service;

import com.yunji.base.dao.IPayoutPersonDao;
import com.yunji.base.domain.PayoutPersonDO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.user.service.impl
 * @Title: PayoutPersonServiceImpl
 * @Description: 转账人员数据接口实现
 * <p>
 * History:
 * Date						Version			Author			Summary
 * ========================================================================
 * 2024-04-28 10:40:58		V1.0			HuaAo		新建类
 */
@Service
public class PayoutPersonService {
    @Resource
    IPayoutPersonDao payoutPersonDao;

    public boolean createPayoutPerson(PayoutPersonDO person) {
        return payoutPersonDao.save(person);
    }


    public boolean updatePayoutPerson(PayoutPersonDO person) {
        return payoutPersonDao.updateById(person);
    }

    public boolean deletePayoutPerson(Long... ids) {
        return payoutPersonDao.removeBatchByIds(Arrays.asList(ids));
    }

//    public List<PayoutPerson> searchPayoutPerson(PayoutPerson person) {
//       // return payoutPersonMapper.searchPayoutPerson(person);
//        return null;
//    }

    public PayoutPersonDO selectPayoutPerson(Long personId) {
        return payoutPersonDao.getById(personId);
    }

    public List<PayoutPersonDO> listByBelongId(Long belongId) {
        return payoutPersonDao.listByBelongId(belongId);
    }

    public PayoutPersonDO getByPayMode(Long belongId, Integer payMode) {
        return payoutPersonDao.getByPayMode(belongId, payMode);
    }
}